<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Contract extends Model
{

    protected $table = 'contracts';
    protected $guarded=[];

    // 此合同所属的项目
    public function projects()
    {
        return $this->belongsTo(Project::class, 'project_id', 'id');
    }

    // 此合同所属于哪一个房屋
    public function houses()
    {
        return $this->belongsTo(Houses::class, 'house_id', 'id');
    }

    // 此合同对同的支付信息
    public function pays()
    {
        return $this->belongsTo(Pay::class, 'id', 'contract_id');
    }

    // 此合同的合同明细
    public function details()
    {
        return $this->belongsTo(ContractDetail::class, 'id', 'contract_id');
    }




}
